/**
 * 
 */
package de.cbf.cam.dsa.model.entities.weapon;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import de.cbf.cam.dsa.model.Activator;
import de.cbf.cam.dsa.model.entities.OneNPC;
import de.cbf.cam.dsa.model.entities.WeaponStyle;

/**
 * @author Nebelritter
 *
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class WeaponRanged extends OneWeapon {

	/**
	 * @param style
	 */
	public WeaponRanged() {
		super();		
	}

	@Override
	public WeaponInUse useIt(OneNPC character,String styleTalentToUse) {
		WeaponStyle style = null;
		for(int i = 0;i < styles.size(); i++){
			if(styles.get(i).getTalentName().equals(styleTalentToUse)){
				style = styles.get(i);
				break;
			}
		}
		if(style==null){
			Activator.logger.error("Chosen styleTalent "+styleTalentToUse+" for useIt not present on weapon "+this);
		}
		WeaponRangedInUse weaponInUse = new WeaponRangedInUse(this, style);
		return weaponInUse;
	}

}
